package com.hivision.streetlight.codec;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;

public class ReportProcess {
    private final int CMDCODE_INDEX = 16;

    public ObjectNode toJsonNode(byte[] binaryData) {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        try {
            if (cmdCode == 1)
                return createHeartBeatNode(binaryData);
            if (cmdCode == 2)
                return createAlarmNode(binaryData);
            if (cmdCode == 3)
                return createUpStatusNode(binaryData);
            if (cmdCode == 263)
                return createAckParamNode(binaryData);
            if (cmdCode == 264)
                return createAckStatusNode(binaryData);
            if (cmdCode == 23)
                return createCriticalStatusNode(binaryData);
            if (cmdCode == 24)
                return createSolarUpStatusNode(binaryData);
            if (cmdCode == 282)
                return createSolarAckParamNode(binaryData);
            if (cmdCode == 285)
                return createSolarAckStatusNode(binaryData);
            if (cmdCode == 260 ||
                    cmdCode == 261 ||
                    cmdCode == 262 ||
                    cmdCode == 265 ||
                    cmdCode == 266 ||
                    cmdCode == 267 ||
                    cmdCode == 268 ||
                    cmdCode == 281 ||
                    cmdCode == 283)
                return createAckExecuteNode(binaryData);
            else{
                return createDecodeFailNode(binaryData);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    private ObjectNode createHeartBeatNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode heartBeatNode = mapper.createObjectNode();
        heartBeatNode.put("serviceId", "Heartbeat");
        ObjectNode heartBeatData = mapper.createObjectNode();
        heartBeatData.put("cmdCode", cmdCode);
        heartBeatData.put("uid", uid);
        heartBeatNode.put("serviceData", (JsonNode)heartBeatData);
        arrynode.add((JsonNode)heartBeatNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createAlarmNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        int alarmType = Utilty.getInstance().bytes2Int(binaryData, 18, 2);
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode alarmNode = mapper.createObjectNode();
        alarmNode.put("serviceId", "Alarm");
        ObjectNode alarmData = mapper.createObjectNode();
        alarmData.put("cmdCode", cmdCode);
        alarmData.put("uid", uid);
        alarmData.put("mid", mid);
        alarmData.put("alarmType", alarmType);
        alarmData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        alarmNode.put("serviceData", (JsonNode)alarmData);
        arrynode.add((JsonNode)alarmNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createUpStatusNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        double voltage = (Utilty.getInstance().bytes2Int(binaryData, 18, 2) * 0.1F);
        double current = (Utilty.getInstance().bytes2Int(binaryData, 20, 2) * 0.1F);
        double electricityConsumption = (Utilty.getInstance().bytes2Int(binaryData, 22, 2) * 0.1F);
        double humidity = (Utilty.getInstance().bytes2Int(binaryData, 24, 2) * 0.1F);
        double temperature = (Utilty.getInstance().bytes2Int(binaryData, 26, 2) * 0.1F);
        double illuminance = (Utilty.getInstance().bytes2Int(binaryData, 28, 2) * 0.1F);
        int brightness = Utilty.getInstance().bytes2Int(binaryData, 30, 2);
        int signalIntensity = Utilty.getInstance().bytes2Int(binaryData, 32, 1);
        int errorRate = Utilty.getInstance().bytes2Int(binaryData, 33, 1);
        voltage = (new BigDecimal(voltage)).setScale(1, 4).doubleValue();
        current = (new BigDecimal(current)).setScale(1, 4).doubleValue();
        electricityConsumption = (new BigDecimal(electricityConsumption)).setScale(1, 4).doubleValue();
        humidity = (new BigDecimal(humidity)).setScale(1, 4).doubleValue();
        temperature = (new BigDecimal(temperature)).setScale(1, 4).doubleValue();
        illuminance = (new BigDecimal(illuminance)).setScale(1, 4).doubleValue();
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode upStatusNode = mapper.createObjectNode();
        upStatusNode.put("serviceId", "DeviceStatus");
        ObjectNode upStatusData = mapper.createObjectNode();
        upStatusData.put("cmdCode", cmdCode);
        upStatusData.put("uid", uid);
        upStatusData.put("mid", mid);
        upStatusData.put("voltage", voltage);
        upStatusData.put("current", current);
        upStatusData.put("electricityConsumption", electricityConsumption);
        upStatusData.put("illuminance", illuminance);
        upStatusData.put("brightness", brightness);
        upStatusData.put("signalIntensity", signalIntensity);
        upStatusData.put("errorRate", errorRate);
        upStatusData.put("temperature", temperature);
        upStatusData.put("humidity", humidity);
        upStatusData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        upStatusNode.put("serviceData", (JsonNode)upStatusData);
        arrynode.add((JsonNode)upStatusNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createAckParamNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        int index = 18;
        int heartBeatIntervel = Utilty.getInstance().bytes2Int(binaryData, index, 2);
        index += 2;
        int uploadInterval = Utilty.getInstance().bytes2Int(binaryData, index, 2);
        index += 2;
        double qianYaVoltage = (Utilty.getInstance().bytes2Int(binaryData, index, 2) * 0.1F);
        index += 2;
        double guoYaVoltage = (Utilty.getInstance().bytes2Int(binaryData, index, 2) * 0.1F);
        index += 2;
        String iotIp = Utilty.getInstance().parseByte2IpStr(binaryData, index);
        index += 4;
        int iotPort = Utilty.getInstance().bytes2Int(binaryData, index, 2);
        qianYaVoltage = (new BigDecimal(qianYaVoltage)).setScale(1, 4).doubleValue();
        guoYaVoltage = (new BigDecimal(guoYaVoltage)).setScale(1, 4).doubleValue();
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode ackParamNode = mapper.createObjectNode();
        ackParamNode.put("serviceId", "DeviceConfig");
        ObjectNode ackParamData = mapper.createObjectNode();
        ackParamData.put("cmdCode", cmdCode);
        ackParamData.put("resultCode", 0);
        ackParamData.put("uid", uid);
        ackParamData.put("mid", mid);
        ackParamData.put("heartBeatIntervel", heartBeatIntervel);
        ackParamData.put("uploadInterval", uploadInterval);
        ackParamData.put("guoYaVoltage", guoYaVoltage);
        ackParamData.put("qianYaVoltage", qianYaVoltage);
        ackParamData.put("iotIP", iotIp);
        ackParamData.put("iotPort", iotPort);
        if (binaryData.length > 34) {
            index += 2;
            double buChangVoltage = (Utilty.getInstance().bytes2SignedInt(binaryData, index, 2) * 0.1F);
            index += 2;
            double buChangCurrent = (Utilty.getInstance().bytes2SignedInt(binaryData, index, 2) * 0.1F);
            index += 2;
            String imei = Utilty.getInstance().parseByte2AscStr(binaryData, index, 32);
            index += 32;
            String sim = Utilty.getInstance().parseByte2AscStr(binaryData, index, 32);
            buChangVoltage = (new BigDecimal(buChangVoltage)).setScale(1, 4).doubleValue();
            buChangCurrent = (new BigDecimal(buChangCurrent)).setScale(1, 4).doubleValue();
            ackParamData.put("buChangVoltage", buChangVoltage);
            ackParamData.put("buChangCurrent", buChangCurrent);
            ackParamData.put("imei", imei);
            ackParamData.put("sim", sim);
        }
        ackParamData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        ackParamNode.put("serviceData", (JsonNode)ackParamData);
        arrynode.add((JsonNode)ackParamNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createAckStatusNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        double voltage = (Utilty.getInstance().bytes2Int(binaryData, 18, 2) * 0.1F);
        double current = (Utilty.getInstance().bytes2Int(binaryData, 20, 2) * 0.1F);
        double electricityConsumption = (Utilty.getInstance().bytes2Int(binaryData, 22, 2) * 0.1F);
        double humidity = (Utilty.getInstance().bytes2Int(binaryData, 24, 2) * 0.1F);
        double temperature = (Utilty.getInstance().bytes2Int(binaryData, 26, 2) * 0.1F);
        double illuminance = (Utilty.getInstance().bytes2Int(binaryData, 28, 2) * 0.1F);
        int brightness = Utilty.getInstance().bytes2Int(binaryData, 30, 2);
        int signalIntensity = Utilty.getInstance().bytes2Int(binaryData, 32, 1);
        int errorRate = Utilty.getInstance().bytes2Int(binaryData, 33, 1);
        voltage = (new BigDecimal(voltage)).setScale(1, 4).doubleValue();
        current = (new BigDecimal(current)).setScale(1, 4).doubleValue();
        electricityConsumption = (new BigDecimal(electricityConsumption)).setScale(1, 4).doubleValue();
        humidity = (new BigDecimal(humidity)).setScale(1, 4).doubleValue();
        temperature = (new BigDecimal(temperature)).setScale(1, 4).doubleValue();
        illuminance = (new BigDecimal(illuminance)).setScale(1, 4).doubleValue();
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode ackStatusNode = mapper.createObjectNode();
        ackStatusNode.put("serviceId", "DeviceStatus");
        ObjectNode ackStatusData = mapper.createObjectNode();
        ackStatusData.put("cmdCode", cmdCode);
        ackStatusData.put("uid", uid);
        ackStatusData.put("mid", mid);
        ackStatusData.put("resultCode", 0);
        ackStatusData.put("voltage", voltage);
        ackStatusData.put("current", current);
        ackStatusData.put("electricityConsumption", electricityConsumption);
        ackStatusData.put("illuminance", illuminance);
        ackStatusData.put("brightness", brightness);
        ackStatusData.put("signalIntensity", signalIntensity);
        ackStatusData.put("errorRate", errorRate);
        ackStatusData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        ackStatusNode.put("serviceData", (JsonNode)ackStatusData);
        arrynode.add((JsonNode)ackStatusNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createAckExecuteNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        int errcode = binaryData[18];
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode ackExecuteNode = mapper.createObjectNode();
        ackExecuteNode.put("serviceId", "DeviceStatus");
        ObjectNode ackackExecuteData = mapper.createObjectNode();
        ackackExecuteData.put("cmdCode", cmdCode);
        ackackExecuteData.put("uid", uid);
        ackackExecuteData.put("mid", mid);
        ackackExecuteData.put("resultCode", errcode);
        ackackExecuteData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        ackExecuteNode.put("serviceData", (JsonNode)ackackExecuteData);
        arrynode.add((JsonNode)ackExecuteNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createDecodeFailNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode decodeFailNode = mapper.createObjectNode();
        decodeFailNode.put("serviceId", "DeviceStatus");
        ObjectNode decodeFailData = mapper.createObjectNode();
        decodeFailData.put("cmdCode", cmdCode);
        decodeFailData.put("uid", uid);
        decodeFailData.put("mid", mid);
        decodeFailData.put("resultCode", 3);
        decodeFailData.put("receiveData", Utilty.parseByte2HexStr(binaryData));
        decodeFailNode.put("serviceData", (JsonNode)decodeFailData);
        arrynode.add((JsonNode)decodeFailNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createCriticalStatusNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        int notifyCode = Utilty.getInstance().bytes2Int(binaryData, 18, 2);
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode ackExecuteNode = mapper.createObjectNode();
        ackExecuteNode.put("serviceId", "DeviceStatus");
        ObjectNode ackackExecuteData = mapper.createObjectNode();
        ackackExecuteData.put("cmdCode", cmdCode);
        ackackExecuteData.put("uid", uid);
        ackackExecuteData.put("mid", mid);
        ackackExecuteData.put("notifyCode", notifyCode);
        ackackExecuteData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        ackExecuteNode.put("serviceData", (JsonNode)ackackExecuteData);
        arrynode.add((JsonNode)ackExecuteNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createSolarUpStatusNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        int dataIndex = 18;
        BigDecimal solarVoltage = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal batteryVoltage = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal ledVoltage = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal solarCurrent = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal chargingCurrent = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal dischargingCurrent = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal ledCurrent = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal chargingPower = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal dischargingPower = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal innerResistance = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        int brightness = binaryData[dataIndex];
        int signalIntensity = binaryData[++dataIndex];
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode upStatusNode = mapper.createObjectNode();
        upStatusNode.put("serviceId", "DeviceStatus");
        ObjectNode upStatusData = mapper.createObjectNode();
        upStatusData.put("cmdCode", cmdCode);
        upStatusData.put("uid", uid);
        upStatusData.put("mid", mid);
        upStatusData.put("solarVoltage", solarVoltage);
        upStatusData.put("batteryVoltage", batteryVoltage);
        upStatusData.put("ledVoltage", ledVoltage);
        upStatusData.put("solarCurrent", solarCurrent);
        upStatusData.put("chargingCurrent", chargingCurrent);
        upStatusData.put("dischargingCurrent", dischargingCurrent);
        upStatusData.put("ledCurrent", ledCurrent);
        upStatusData.put("chargingPower", chargingPower);
        upStatusData.put("dischargingPower", dischargingPower);
        upStatusData.put("innerResistance", innerResistance);
        upStatusData.put("brightness", brightness);
        upStatusData.put("signalIntensity", signalIntensity);
        upStatusData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        upStatusNode.put("serviceData", (JsonNode)upStatusData);
        arrynode.add((JsonNode)upStatusNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createSolarAckParamNode(byte[] binaryData) throws UnsupportedEncodingException {
        int cmdCode = Utilty.getInstance().bytes2Int(binaryData, 16, 2);
        int mid = Utilty.getInstance().bytes2Int(binaryData, 14, 2);
        String uid = Utilty.getInstance().parseByte2AscStr(binaryData, 6, 8);
        int dataIndex = 18;
        int reportInterval = Utilty.getInstance().bytes2Int(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal qianYaThreshold = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal guoYaThreshold = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal guoLiuThreshold = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal guoWenThreshold = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal tianLiangThreshold = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal tianHeiThreshold = data2BigDecimal(binaryData, dataIndex, 2);
        dataIndex += 2;
        int batterType = Utilty.getInstance().bytes2Int(binaryData, dataIndex, 2);
        dataIndex += 2;
        int batterNumber = Utilty.getInstance().bytes2Int(binaryData, dataIndex, 2);
        dataIndex += 2;
        BigDecimal ledRatedCurrent = data2BigDecimal(binaryData, dataIndex, 2);
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode root = mapper.createObjectNode();
        root.put("identifier", uid);
        root.put("msgType", "deviceReq");
        root.put("hasMore", 0);
        ArrayNode arrynode = mapper.createArrayNode();
        ObjectNode upStatusNode = mapper.createObjectNode();
        upStatusNode.put("serviceId", "DeviceStatus");
        ObjectNode upStatusData = mapper.createObjectNode();
        upStatusData.put("cmdCode", cmdCode);
        upStatusData.put("uid", uid);
        upStatusData.put("mid", mid);
        upStatusData.put("reportInterval", reportInterval);
        upStatusData.put("qianYaThreshold", qianYaThreshold);
        upStatusData.put("guoYaThreshold", guoYaThreshold);
        upStatusData.put("guoLiuThreshold", guoLiuThreshold);
        upStatusData.put("guoWenThreshold", guoWenThreshold);
        upStatusData.put("tianLiangThreshold", tianLiangThreshold);
        upStatusData.put("tianHeiThreshold", tianHeiThreshold);
        upStatusData.put("batterType", batterType);
        upStatusData.put("batterNumber", batterNumber);
        upStatusData.put("ledRatedCurrent", ledRatedCurrent);
        upStatusData.put("deviceData", Utilty.parseByte2HexStr(binaryData));
        upStatusNode.put("serviceData", (JsonNode)upStatusData);
        arrynode.add((JsonNode)upStatusNode);
        root.put("data", (JsonNode)arrynode);
        return root;
    }

    private ObjectNode createSolarAckStatusNode(byte[] binaryData) throws UnsupportedEncodingException {
        return createSolarUpStatusNode(binaryData);
    }

    private BigDecimal data2BigDecimal(byte[] binaryData, int index, int length) {
        int data = Utilty.getInstance().bytes2Int(binaryData, index, length);
        BigDecimal bigData = (new BigDecimal(data)).divide(new BigDecimal(10));
        return bigData.setScale(1, 4);
    }

    public static void main(String[] args) {
        byte[] t = Utilty.hexString2Bytes("40232600100648562D534F4C41300200180094007F00EB000C00130017000B002F004E006400381651AF");
        ReportProcess reportProcess = new ReportProcess();
        ObjectNode parseNode = reportProcess.toJsonNode(t);
        System.out.println(parseNode.toString());
    }
}